import React, { FC } from "react";
import { Text, TextStyle } from "react-native";

type Props = {
  color?: string;
  size?: number;
  bold?: boolean;
  style?: TextStyle;
  [index: string]: any;
};

const YText: FC<Props> = ({ color, size, style, bold, children, ...rest }) => {
  const _style: TextStyle = {
    color: color,
    fontSize: size,
    fontWeight: bold ? "bold" : "normal",
    ...style,
  };

  return (
    <Text style={_style} {...rest}>
      {children}
    </Text>
  );
};

export default YText;
